function PageList(CurrentPage,n,MaxRows,CountNum,PageSearch,v,getdata)
{
 var PageStr="";
 if (PageSearch!=''){
  PageSearch+="&";
 }
 CountNum=parseInt(CountNum);
 CurrentPage=parseInt(CurrentPage);
 if (CountNum%MaxRows==0){var Pagecount= parseInt(CountNum / MaxRows);}else{var Pagecount = parseInt(CountNum / MaxRows)+1}
 if (Pagecount>CurrentPage+n){var Endpage=CurrentPage+n;}else{var Endpage=Pagecount;}
 var ShowPage;
 switch (v)
 {
  case 1:
   ShowPage="<table border=\"0\" Style=\"width:98%\" align=center cellpadding=0 cellspacing=2><FORM action=\"\" method=GET name=\"PageForm\">";
   PageStr = SeachPage(CurrentPage,n,MaxRows,Endpage,Pagecount,PageSearch,1)
   ShowPage+="<tr><td nowrap>";
   ShowPage+="页次：<b><font color=red>"+CurrentPage+"</font></b>/<b>"+Pagecount+"</b>页";
   ShowPage+="．每页：显示<b>"+MaxRows+"</b>条 共：<b>"+CountNum+"</b>条记录</td>";
   ShowPage+="<td valign=middle nowrap align=right>";
   ShowPage+=PageStr;
   ShowPage+="</td><td width=75 noWrap align=right><input type=text name=page size=4 value=\""+CurrentPage+"\"><input type=button onclick=\"submit(this)\" value=\">>\" title=\"填写翻转的分页，然后点击查看！\"></td></tr>";
   ShowPage+="</FORM></table>";
   break;
  case 2:
   ShowPage="<table border=\"0\" align=center cellpadding=0 cellspacing=2><form action=\"?"+PageSearch+"\" method=\"get\" name=\"PageForm\">";
   PageStr = SeachPage(CurrentPage,n,MaxRows,Endpage,Pagecount,PageSearch,2)
   ShowPage+="<tr><td nowrap>";
   ShowPage+="共有<font color=red>"+CountNum+"</font>条;第：<font color=red>"+CurrentPage+"</font> 页/共 <font color=red>"+Pagecount+"</font> 页";
   ShowPage+="</td><td valign=middle nowrap align=left>";
   ShowPage+=PageStr;
   ShowPage+="</td><td  noWrap align=left><input type=text name=page size=4 value=\""+CurrentPage+"\"><input type=button onclick=\"submit(this)\" value=\"GO\" title=\"填写翻转的分页，然后点击查看！\"></td></tr>";
   ShowPage+="</FORM></table>";
   break;
  case 3:
   PageStr = SeachPage(CurrentPage,n,MaxRows,Endpage,Pagecount,PageSearch,3)
   ShowPage="<table cellpadding=0 cellspacing=1 class=tableborder5>";
   ShowPage=ShowPage+"<FORM action=\""+PageSearch+"\" method=GET name=\"PageForm\" target=\"hiddenframe\"><tr align=center>";
   ShowPage=ShowPage+"<td class=tabletitle1 title=\"总数\">&nbsp;"+CountNum+"&nbsp;</td>";
   ShowPage=ShowPage+"<td class=tabletitle1 title=\"本页贴数\">&nbsp;"+MaxRows+"&nbsp;</td>";
   ShowPage=ShowPage+"<td class=tabletitle1 title=\"分页\">&nbsp;"+CurrentPage+"/"+Pagecount+"&nbsp;</td>";
   ShowPage=ShowPage+"";
   ShowPage=ShowPage+PageStr
   ShowPage=ShowPage+"<td class=tablebody1><input type=text name=star size=2 value=\""+CurrentPage+"\" Class=PageInput><input type=submit value=GO name=submit Class=PageInput></td>";
   ShowPage=ShowPage+"</tr></FORM></table>";
   break;
  case 4:
   PageStr = SeachPage(CurrentPage,n,MaxRows,Endpage,Pagecount,PageSearch,4)
   ShowPage="<table cellpadding=0 cellspacing=1 class=tableborder5>";
   ShowPage=ShowPage+"<FORM action=\"?"+PageSearch+"\" method=GET name=\"PageForm\"><tr align=center>";
   ShowPage=ShowPage+"<td class=tabletitle1 title=\"总数\">&nbsp;"+CountNum+"&nbsp;</td>";
   ShowPage=ShowPage+"<td class=tabletitle1 title=\"本页贴数\">&nbsp;"+MaxRows+"&nbsp;</td>";
   ShowPage=ShowPage+"<td class=tabletitle1 title=\"分页\">&nbsp;"+CurrentPage+"/"+Pagecount+"&nbsp;</td>";
   ShowPage=ShowPage+"";
   ShowPage=ShowPage+PageStr
   ShowPage=ShowPage+"<td class=tablebody1><input type=text name=page size=2 value=\""+CurrentPage+"\" Class=PageInput><input type=submit value=GO name=submit Class=PageInput></td>";
   ShowPage=ShowPage+"</tr></FORM></table>";
   break;
     case 5:
   ShowPage="<table border=\"0\" align=center cellpadding=0 cellspacing=2><form action=\"?"+PageSearch+"\" method=\"get\" name=\"PageForm\">";
   PageStr = SeachPage(CurrentPage,n,MaxRows,Endpage,Pagecount,PageSearch,5)
   ShowPage+="<tr><td nowrap>";
   ShowPage+="共有<font color=red>"+CountNum+"</font>条记录 第：<font color=red>"+CurrentPage+"</font> 页/共 <font color=red>"+Pagecount+"</font> 页";
   ShowPage+="</td><td valign=middle nowrap align=left>";
   ShowPage+=PageStr;
   ShowPage+="</td></tr>";
   ShowPage+="</FORM></table>";
   break;

 }
 if (getdata)
 {
  return ShowPage;
 }
 else{
  document.write (ShowPage);
 }
}
function SeachPage(CurrentPage,n,MaxRows,Endpage,Pagecount,PageSearch,v) {
var PageStr="";
switch (v)
{
 case 1:
  if (CurrentPage>n+1){PageStr="<a href=\"?"+PageSearch+"page=1\">[1]</a> ...";}
  for (var i=CurrentPage-n;i<=Endpage;i++)
  {
   if (i>=1)
   {
    if (i==CurrentPage)
    {
     PageStr+="<font color=Red>["+i+"]</font>";
    }else{
     PageStr+="<a href=\"?"+PageSearch+"page="+i+"\">["+i+"]</a>";
    }
   }
  }
  if (Pagecount>CurrentPage+n){PageStr+="...<a href=\"?"+PageSearch+"page="+Pagecount+"\" class=path>["+Pagecount+"]</a>";}
 break;
 case 2:
  var p;
  if ((CurrentPage-1)%n==0) 
  {
   p=(CurrentPage-1) /n
  }
  else
  {
   p=(((CurrentPage-1)-(CurrentPage-1)%n)/n)
  }
  if (CurrentPage!=1)
  {
   PageStr += " <a href=\"?"+PageSearch+"page=1\" title=\"首页\">首页</a> ";
  }

  if (p*n > 0)
  {
   PageStr += " <a href=\"?"+PageSearch+"page="+p*n+"\" title=\"上五页\">上页</a> ";
  }
  //PageStr += "<b>";
  for (var i=p*n+1;i<p*n+n+1;i++)
  {
   if (i==CurrentPage)
   {
    PageStr += " <font color=\"red\">["+i+"]</font> ";
   }
   else
   {
    PageStr += " <a href=\"?"+PageSearch+"page="+i+"\">"+i+"</a> ";
   }
   if (i==Pagecount) break;
  }
  //PageStr += "</b>";
  if (i<Pagecount)
  {
   PageStr += " <a href=\"?"+PageSearch+"page="+i+"\" title=\"下五页\">下五页</a> ";
  }
  if (CurrentPage!=Pagecount)
  {
   PageStr += " <a href=\"?"+PageSearch+"page="+Pagecount+"\" title=\"尾页\">尾页</a> ";
  }
 break;
 case 3:
  var p;
  if ((CurrentPage-1)%n==0) 
  {
   p=(CurrentPage-1) /n
  }
  else
  {
   p=(((CurrentPage-1)-(CurrentPage-1)%n)/n)
  }
  if (CurrentPage!=1)
  {   
   PageStr+="<td class=tablebody1>&nbsp;<a href=\""+PageSearch+"star=1\" title=\"第一页\" target=\"hiddenframe\"> 第一页 </a>&nbsp;</td>";
  }
  //else{
   //PageStr+="<td class=tablebody1><font style="font-family:webdings">9</font></td>";
  //}
  if (p*n > 0)
  {
   PageStr +="<td class=tablebody1>&nbsp;<a href=\""+PageSearch+"star="+p*n+"\" title=\"上十页\" target=\"hiddenframe\"> 上十页 </a>&nbsp;</td>";
  }
  for (var i=p*n+1;i<p*n+n+1;i++)
  {
   if (i==CurrentPage)
   {
    PageStr+="<td class=tablebody2>&nbsp;<B><font color=\"red\">"+i+"</font></B></td>";
   }
   else
   {
    PageStr+="<td class=tablebody1>&nbsp;<a href=\""+PageSearch+"star="+i+"\" target=\"hiddenframe\">"+i+"</a>&nbsp;</td>";
   }
   if (i==Pagecount) break;
  }
  if (i<Pagecount)
  {
   PageStr+="<td class=tablebody1>&nbsp;<a href=\""+PageSearch+"star="+i+"\" title=\"下十页\" target=\"hiddenframe\"> 下十页 </a>&nbsp;</td>";
  }
  if (CurrentPage<Pagecount)
  {
   PageStr+="<td class=tablebody1>&nbsp;<a href=\""+PageSearch+"star="+Pagecount+"\" title=\" 尾页 \" target=\"hiddenframe\"> 尾页 </a>&nbsp;";
   PageStr+="</td>";
  }
 break;

 case 4:
  var p;
  if ((CurrentPage-1)%n==0) 
  {
   p=(CurrentPage-1) /n
  }
  else
  {
   p=(((CurrentPage-1)-(CurrentPage-1)%n)/n)
  }
  if (CurrentPage!=1)
  {   
   PageStr+="<td class=tablebody1>&nbsp;<a href=\"?"+PageSearch+"page=1\" title=\"第一页\">第一页</a>&nbsp;</td>";
  }
  if (p*n > 0)
  {
   PageStr +="<td class=tablebody1>&nbsp;<a href=\"?"+PageSearch+"page="+p*n+"\" title=\"上十页\">上十页</a>&nbsp;</td>";
  }
  for (var i=p*n+1;i<p*n+n+1;i++)
  {
   if (i==CurrentPage)
   {
    PageStr+="<td class=tablebody2>&nbsp;<B><font color=\"red\">"+i+"</font></B></td>";
   }
   else
   {
    PageStr+="<td class=tablebody1>&nbsp;<a href=\"?"+PageSearch+"page="+i+"\">"+i+"</a>&nbsp;</td>";
   }
   if (i==Pagecount) break;
  }
  if (i<Pagecount)
  {
   PageStr+="<td class=tablebody1>&nbsp;<a href=\"?"+PageSearch+"page="+i+"\" title=\"下十页\">下十页</a>&nbsp;</td>";
  }
  if (CurrentPage<Pagecount)
  {
   PageStr+="<td class=tablebody1>&nbsp;<a href=\"?"+PageSearch+"page="+Pagecount+"\" title=\"尾页\">尾页</a>&nbsp;";
   PageStr+="</td>";
  }
 break;
  case 5:
  var p;
  if ((CurrentPage-1)%n==0) 
  {
   p=(CurrentPage-1) /n
  }
  else
  {
   p=(((CurrentPage-1)-(CurrentPage-1)%n)/n)
  }
  if (CurrentPage!=1)
  {
   PageStr += " <a href=\"?"+PageSearch+"page=1\" title=\"首页\"><img src=\"/image/hotel_020_a.gif\" border=\"0\" alt=\"首页，第一条\"></a> ";
  }

  if (p*n > 0)
  {
   PageStr += " <a href=\"?"+PageSearch+"page="+p*n+"\" title=\"上五页\"><img src=\"/image/hotel_020_b.gif\" border=\"0\" alt=\"上五页\"></a> ";
  }
  //PageStr += "<b>";
  for (var i=p*n+1;i<p*n+n+1;i++)
  {
   if (i==CurrentPage)
   {
    PageStr += " <a class='on'><font color=red>["+i+"]</font></a> ";
   }
   else
   {
    PageStr += " <a href=\"?"+PageSearch+"page="+i+"\">"+i+"</a> ";
   }
   if (i==Pagecount) break;
  }
  //PageStr += "</b>";
  if (i<Pagecount)
  {
   PageStr += " <a href=\"?"+PageSearch+"page="+i+"\" title=\"下五页\"><img src=\"image/hotel_020_c.gif\" border=\"0\" alt=\"下五页\"></a> ";
  }
  if (CurrentPage!=Pagecount)
  {
   PageStr += " <a href=\"?"+PageSearch+"page="+Pagecount+"\" title=\"尾页\"><img src=\"image/hotel_020_d.gif\" border=\"0\" alt=\"尾页，最后一条\"></a> ";
  }
 break;

 
}
 return PageStr;
}
